package transaction

import (
	"bytes"
	"encoding/gob"
)


type Transaction struct {
	//交易id
	TXHash []byte
	//交易输入
	Input []Input
	//交易输出
	Output []Output
}
//交易序列化
func(tx *Transaction)Serialize()([]byte,error){
	var re bytes.Buffer
	en :=gob.NewEncoder(&re)
	err :=en.Encode(tx)
	if err != nil {
		return nil,err
	}
	return re.Bytes(),nil
}